ETAPI (REST API)

ETAPI is Trilium's public/external REST API. It is available since Trilium v0.50.

The documentation is in OpenAPI format, available here.

API clients

As an alternative to calling the API directly, there are client libraries to simplify this

Authentication

All operations have to be authenticated using a token. You can get this token either from Options -> ETAPI or programmatically using the /auth/login REST call (see the spec):

GET https://myserver.com/etapi/app-info
Authorization: ETAPITOKEN

Alternatively, since 0.56 you can also use basic auth format:

GET https://myserver.com/etapi/app-info
Authorization: Basic BATOKEN

Basic Auth is meant to be used with tools which support only basic auth.

Interaction using Bash scripts

It is possible to write simple Bash scripts to interact with Trilium. As an example, here's how to obtain the HTML content of a note:

#!/usr/bin/env bash

# Configuration
TOKEN=z1vA4fkGxjOR_ZXLrZeqHEFOv65yV3882iFCRtNIK9k9iWrHliITNSLQ=
SERVER=http://localhost:8080

# Download a note by ID
NOTE_ID="i6ra4ZshJhgN"
curl "$SERVER/etapi/notes/$NOTE_ID/content" -H "Authorization: $TOKEN" 

Make sure to replace the values of: